package everydayGrade.t6;

import java.util.Arrays;

/**
 * @Author: Siantar
 * @Date: 2023-10-09-13:50
 * @Description: 1.0
 */
public class T2578 {
    public int splitNum(int num) {
        char[] cs = String.valueOf(num).toCharArray();
        Arrays.sort(cs);
        int nums1 = 0, nums2 = 0;
        for (int i = 0; i < cs.length; i++) {
            if (i % 2 == 0) {
                nums1 = nums1 * 10 + (cs[i] - '0');
            } else {
                nums2 = nums2 * 10 + (cs[i] - '0');
            }
        }
        return nums1 + nums2;
    }
}
